<template>
  <div class="container">
    <div class="block">
        <el-carousel :interval="5000" arrow="hover" height="660px">
        <el-carousel-item v-for="item in slideshow" :key="item.length">
          <img :src=" $axios.defaults.baseURL + item.url" :alt="item.desc">
        </el-carousel-item>
      </el-carousel>
    </div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      slideshow:''
    }
  },
  created(){
    this.requestimg()
  },
  methods:{
    requestimg(){
      this.$axios.get('/scenics/banners')
      .then(res=>{
        console.log(res);
        this.slideshow = res.data.data
      })
    }
  }
}
</script>

<style lang="less" scoped>

.el-carousel__item h3 {
    color: #475669;
    font-size: 18px;
    opacity: 0.75;
    margin: 0;
    height: 100%;
  }
  
  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }
  
  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
</style>
